<?php

$title = 'My albums';
$this->headTitle($title);

?>
<div class="panel panel-primary">
	<div class="panel-heading">
		<h2><?php echo $this->escapeHtml($title); ?></h2>
	</div>
	<div class="panel-body">
		<p>
			<a class="btn btn-primary" href="<?php echo $this->url('album', array('action'=>'add'));?>">Add new album</a>
		</p>

		<table class="table">
		<tr>
			<th>Title</th>
			<th>Artist</th>
			<th>&nbsp;</th>
		</tr>
		<?php foreach ($albums as $album) : ?>
		<tr>
			<td><?php echo $this->escapeHtml($album->title);?></td>
			<td><?php echo $this->escapeHtml($album->artist);?></td>
			<td>
				<a class="btn btn-success" href="<?php echo $this->url('album',
					array('action'=>'edit', 'id' => $album->id));?>">Edit</a>
				<a class="btn btn-danger" href="<?php echo $this->url('album',
					array('action'=>'delete', 'id' => $album->id));?>">Delete</a>
			</td>
		</tr>
		<?php endforeach; ?>
		</table>
	</div>
</div>